<template>
  <div class="process">
    <div class="process-top">
      <div class="process-time">
        <img src="@/assets/images/clock.png" class="process-clock" />
        <div class="process-time-date">{{ date }}</div>
      </div>
      <div class="process-legend process-legend-total">累计生产数</div>
      <div class="process-legend process-legend-current">当前生产数</div>
      <div class="process-legend process-legend-debt">欠数</div>
      <rb-button class="process-legend">确认换班</rb-button>
    </div>
    <div class="process-center">
      <div class="process-center-left">
        <div class="process-orders-total">订单总数量：7620</div>
        <div class="process-tag-container">
          <div class="process-tag process-tag-total">368</div>
          <div class="process-tag process-tag-current">1198</div>
          <div class="process-tag process-tag-debt">2376</div>
        </div>
      </div>
      <rb-button class="process-next-btn">
        下一页 <img src="@/assets/images/next.png" class="process-next-icon" />
      </rb-button>
    </div>
    <div class="process-bottom">
      <ProcessItem></ProcessItem>
      <ProcessItem></ProcessItem>
      <ProcessItem></ProcessItem>
      <ProcessItem></ProcessItem>
      <ProcessItem></ProcessItem>
    </div>
  </div>
</template>

<script setup>
import ProcessItem from "./components/ProcessItem.vue";
import { dayjs } from "element-plus";
const date = ref(dayjs().format("YYYY-MM-DD HH:mm:ss"));
const timer = setInterval(() => {
  date.value = dayjs().format("YYYY-MM-DD HH:mm:ss");
}, 1000);
onUnmounted(() => {
  if (timer) {
    clearInterval(timer);
  }
});
</script>

<style lang='scss'>
.process {
  line-height: 1;
  padding: 28px 54px;
  .process-top {
    display: flex;
    align-items: center;
    gap: 30px;
    .process-time {
      width: 338px;
      height: 58px;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 24px;
      background: #fff;
      box-shadow: var(--box-shadow);
      border-radius: 6px;
    }
    .process-clock {
      width: 30px;
      height: 30px;
    }
    .process-time-date {
      font-size: 20px;
    }
    .process-legend {
      width: 190px;
      height: 58px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 24px;
      color: #fff;
    }
    .process-legend-total {
      border-radius: 6px;
      background-image: var(--green-gradient-color);
    }
    .process-legend-current {
      border-radius: 6px;
      background-image: var(--blue-gradient-color);
    }
    .process-legend-debt {
      color: var(--red-color);
      border-radius: 6px;
      background-image: var(--bg-gradient-color);
    }
  }
  .process-center {
    margin-top: 36px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    .process-center-left {
      display: flex;
      align-items: center;
      gap: 84px;
    }
    .process-orders-total {
      font-size: 32px;
      font-weight: bold;
    }
    .process-tag-container {
      display: flex;
      align-items: center;
    }
    .process-tag {
      padding: 15px 42px;
      min-width: 136px;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 28px;
      font-weight: bold;
      color: #fff;
      line-height: 1;
    }
    .process-tag-total {
      border-radius: 6px 0 0 6px;
      background-image: var(--green-gradient-color);
    }
    .process-tag-current {
      background-image: var(--blue-gradient-color);
    }
    .process-tag-debt {
      color: var(--red-color);
      border-radius: 0 6px 6px 0;
      background-image: var(--bg-gradient-color);
    }
    .process-next-btn {
      width: 226px;
      height: 70px;
      font-size: 32px;
      .process-next-icon {
        width: 30px;
        height: 30px;
        margin-left: 18px;
      }
    }
  }
  .process-bottom {
    margin-top: 46px;
    display: flex;
    flex-direction: column;
    gap: 40px;
  }
}
</style>